package main

type Mario struct {
	score           int64
	smallMarioState MarioState
	superMarioState MarioState
	capeMarioState  MarioState

	status MarioState
}

func (m *Mario) GetName() string {
	return m.status.Name()
}

func (m *Mario) ChangeState(state MarioState) {
	m.status = state
}

func NewMario() *Mario {
	mario := &Mario{
		score:           0,
		smallMarioState: nil,
		superMarioState: nil,
		capeMarioState:  nil,
		status:          nil,
	}
	smallMarioState := &SmallMarioState{mario: mario}
	superMarioState := &SuperMarioState{mario: mario}
	capeMarioState := &CapeMarioState{mario: mario}

	mario.smallMarioState = smallMarioState
	mario.superMarioState = superMarioState
	mario.capeMarioState = capeMarioState
	mario.status = smallMarioState

	return mario
}
